<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style type="text/css">
		#tp{
			margin: 10px 10px;
		}
		#an{
			margin-left: 40px;
		}
	</style>
	<body>
		<div id="tp">
			<img src="./img1/1.jpg">
		</div>
		<div id="an">
			<button type="button" onclick="doBegin()">开始</button>
		</div>
	</body>
	
	<script type="text/javascript">
		function doBegin(){
			var a=1;
			setInterval(function(){
				var imgs = document.getElementsByTagName('img')[0];
				a++;
				imgs.src = "./img1/"+ a +".jpg";
				if (a >= 9){
					a=0;
				}
			},1000);
		}
	</script>
</html>
